QT += core gui network charts widgets serialport


CONFIG += c++17

#TARGET = QMCC
TARGET = qmcc
TEMPLATE = app

OBJECTS_DIR += _build
#MOC_DIR += _moc
#RCC_DIR += _rcc
#UI_DIR += _ui

SOURCES += \
    main/main.cpp \
    src/alert/alert.cpp \
    src/config/config.cpp \
    src/config/configmanager.cpp \
    src/ds9/ds9.cpp \
    src/exposure/exposure.cpp \
    src/fits/fitsconverter.cpp \
    src/history/history.cpp \
    src/log/log.cpp \
    src/misc/misc.cpp \
    src/network/network.cpp \
    src/ocs/ocs.cpp \
    src/power/power.cpp \
    src/ps/masterPS.cpp \
    src/ps/slavePS.cpp \
    src/slots/slots.cpp \
    src/temp_vaccum/temp_vaccum.cpp \
    src/ui/mainwindow.cpp \
    src/ui/ui_status.cpp



HEADERS += \
    include/configmanager.h \
    include/fitsconverter.h \
    include/mainwindow.h \
    include/Alarm.h \
    include/exposure.h \
    include/hardware_status.h \
    include/camera_enmu.h \
    include/camera_states.h \
    include/led.h \
    ui_mainwindow.h
    


FORMS += \
    mainwindow.ui

# Python支持（如果需要）
unix {
    CONFIG += link_pkgconfig
    #PKGCONFIG += python3
    #PKGCONFIG += cfitsio  # 使用pkg-config查找cfitsio
    INCLUDEPATH += /usr/include \
                    $$PWD/include \
                    /opt/homebrew/Cellar/cfitsio/4.6.2/include/
#    LIBS += -L /Users/xyh/anaconda3/envs/astro/lib -lQt5Charts -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core -lQt5SerialPort
#    LIBS += -L /opt/homebrew/lib/ -lcfitsio
    LIBS += -lcfitsio
    # 如果pkg-config不可用，可以手动指定路径
    # INCLUDEPATH += /usr/local/include
    # LIBS += -L/usr/local/lib -lcfitsio
}
# 增加编译器内存限制
QMAKE_CXXFLAGS += -ftemplate-depth=1000

# Linux 特定设置
linux {
    # 栈大小设置（Linux格式）
    QMAKE_LFLAGS += -Wl,-z,stack-size=16777216

    # 添加Linux所需的库路径
    LIBS += -L/usr/lib/x86_64-linux-gnu
    LIBS += -lQt5Charts -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core -lQt5SerialPort
}

# Windows 特定设置
win32 {
    # Windows栈大小设置
    QMAKE_LFLAGS += -Wl,--stack,16777216

    # MinGW专用链接配置
    win32-g++ {
        LIBS += -lQt5Charts
        QMAKE_LIBDIR += $$[QT_INSTALL_LIBS]
    }
}

# 禁用预编译头(如果不需要)
PRECOMPILED_HEADER =

# 优化编译选项
CONFIG += optimize_full

# RC_ICONS = icons/icon.png  # 编译时嵌入 .ico 文件
RESOURCES += \
    resource.qrc
